var xtSmsWinAdd;
var xtSmsFormAdd;
function addXtSms(){
	initXtSmsFormAdd();
	xtSmsWinAdd = Ext.create('Ext.Window',{
		layout:'fit',
		width:800,
		height:450,
		maximizable:true,
		minimizable:true,
		animateTarget:document.body,
		plain:true,
		modal:true,
		title:'添加信息',
		listeners:{
			minimize:function(win,opts){
				if(!win.collapse()){
					win.collapse();
				}else{
					win.expand();
				}
			}
		},
		items:xtSmsFormAdd,
		buttons:[{
			text:'保存',
			itemId:'save',
			handler:function(button){
				submitForm(xtSmsFormAdd,'../xtSmsController/addXtSms',grid,xtSmsWinAdd,false,true);
			}
		},{
			text:'关闭',
			itemId:'close',
			handler:function(button){
				button.up('window').close();
			}
		}]
	});
	xtSmsWinAdd.show();
}
function initXtSmsFormAdd(){
	xtSmsFormAdd = Ext.create('Ext.FormPanel',{
		xtype:'form',
		labelWidth:50,
		waitMsgTarget:true,
		defaultType:'textfield',
		autoScroll:true,
		fieldDefaults:{
			labelWidth:70,
			labelAlign:'left',
			flex:1,
			margin:'4 5 4 5'
		},
		items:[
		{
			fieldLabel:'用&nbsp;&nbsp;户&nbsp;名',
			xtype:'textfield',
			name:'xt_smsName',
			maxLength:50,
			anchor:'40%'
		},
		{
			fieldLabel:'接口密码',
			xtype:'textfield',
			name:'xt_smsPWD',
			maxLength:50,
			anchor:'40%'
		},
		{
			fieldLabel:'URL地址',
			xtype:'textfield',
			name:'xt_smsURL',
			maxLength:200,
			anchor:'100%'
		},
		{
			fieldLabel:'公&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;司',
			xtype:'textfield',
			name:'xt_smsCompany',
			maxLength:100,
			anchor:'100%'
		},
		{
			fieldLabel:'电&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;话',
			xtype:'textfield',
			name:'xt_smsCompanTel',
			maxLength:20,
			anchor:'40%'
		},
		{
			fieldLabel:'短信平台',
			xtype:'textfield',
			name:'xt_smsValue',
			maxLength:20,
			anchor:'40%'
		},
		{
			fieldLabel:'公司地址',
			xtype:'textarea',
			name:'xt_smsCompanyAddress',
			maxLength:200,
			anchor:'100%'
		},
		{
			fieldLabel:'联&nbsp;&nbsp;系&nbsp;人',
			xtype:'textfield',
			name:'xt_smsCompanyContacts',
			maxLength:20,
			anchor:'40%'
		},
		{
			fieldLabel:'协议类型',
			value:'0',
			name:'xt_smsType',
			hiddenName:'xt_smsType',
            xtype:"combo",
            anchor:'40%',
            store:[["0","http"],["1","其他"]],
            emptyText:"请选择",
            mode:"local",
            triggerAction:"all",
            editable:false
		},
		{
			fieldLabel:'状&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;态',
			value:'0',
			name:'xt_smsState',
			anchor:'40%',
			hiddenName:'xt_smsState',
            xtype:"combo",
            store:[["0","暂停"],["1","启用"]],
            emptyText:"请选择",
            mode:"local",
            triggerAction:"all",
            editable:false
		}
		]
	});
}
